home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-04
/
ov_all.zip
/
TI742.ASC
< prev
next >
Wrap
Text File
|
1992-01-28
|
5KB
|
133 lines
PRODUCT : ObjectVision NUMBER : 742
VERSION : 2.0
OS : WIN
DATE : January 28, 1992 PAGE : 1/2
TITLE : Using DLL's with ObjectVision
Q. Where do I get additional information about creating DLL's to
work with OV?
A. Your most valuable information will come from the CHOICE.C,
OVLOOPS.C, RAND.PAS, and TSTCOM.PAS example files in the
sample directory. These will show you the syntax for
declaring your functions in the DLL, as well as some of the
more common "how-to"'s such as self-registering the functions
(OVLOOPS.C) in the DLL, getting/putting information in an OV
field, and executing OV functions from within your DLL. More
importantly, these examples will give you a feel for how to
work with OV from within your DLL.
Q. The documentation lists the callback functions you pass as
argument types to your DLL, but it does not explain the
parameters for them. Where is this information?
A. You can find the descriptions of the functions as well as
their prototypes in the file CHOICE.H in your sample
directory.
Q. How do I change an OV field from within my DLL?
A. You can manipulate fields from within your DLL in different
ways. The GET and PUT callback functions allow direct access
to fields and both take the field name (as a character string)
as a parameter. Another way is to use the EXECUTESTRING
function (CHOICE.H) to execute an OV command such as @ASSIGN.
This method, while being less efficient than using GET or PUT,
opens the door to any of the functionality of ObjectVision to
your DLL. A third method is to pass the field as a parameter
to your function and pass the updated value back as a return
type. This method would look something like this
"@ASSIGN(Field1, @MYFUNC(Field1))" in your OV form. Examples
of these methods can be found in the OVLOOPS.C.
Q. What are the hMainWindow (y) and hInst (z) argument types?
A. These are the HWND and instance HANDLE of the ObjectVision's
main window. This allows you to call Windows API functions
that need an HWND or an INSTANCE from within your DLL
function. Use these with care!
Q. OVLOOPS.DLL uses a function called EXECUTESTRING, but I don't
see this in the list of argument types in the manual. What is
this function?
PRODUCT : ObjectVision NUMBER : 742
VERSION : 2.0
OS : WIN
DATE : January 28, 1992 PAGE : 2/2
TITLE : Using DLL's with ObjectVision
A. This is a function which was added to ObjectVision after the
documentation went to the printer. Its purpose is to allow
you to execute OV functions from within your DLL, thus opening
up all the power of OV to your DLL. You can find it
documented in the file CHOICE.H in your sample directory.
Q. What is the difference between the C string (C) argument type
and the C string buffer (F) argument type?
A. The only difference is that the buffer type (F) will point to
a 4K buffer which OV has allocated for you to use within your
function. The memory will be deallocated upon return from
your function. The buffer is not stored permanently in OV, so
if you want the data in the buffer to be stored in an OV field
you should use the PUT callback function. This reduces your
responsibility of allocating and deallocating memory within
your DLL, making it simpler to write.
Q. How do I debug my DLL with TDW?
A. Debugging your DLL for ObjectVision is no different than
debugging any DLL under Windows, just remember that
ObjectVision is the application that loads the DLL, so it is
the file you will load under the debugger. For information on
debugging DLL's refer to the TDW section of your Turbo
Debugger manual. A shortcut to getting a breakpoint in your
DLL is to generate an interrupt 3 ('geninterrupt(3);' if your
using C or 'inline($cc);' if you are using PASCAL) in your
function where you want the breakpoint. This saves you the
trouble of loading the DLL in TDW first to set a breakpoint.
Q. Can I use OWL to create my DLL?
A. Yes, you can, but the entry points to your DLL ( i.e. the
functions you register with @REGISTER ) must be C functions.